home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_dos.lha / dos / sphsrc / macros.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-26  |  652 b   |  25 lines

  1. /** MEMORY ALLOCATION MACROS
  2. Handles differences between Macintosh and UNIX.
  3. **/
  4.  
  5. #ifdef THINK_C
  6. #define MALLOCARGTYPE   size_t
  7. #else
  8. #define MALLOCARGTYPE   unsigned
  9. #endif
  10.  
  11. #define ALLOC_RECORDS(PTR,TYPE,NUM) \
  12.    if ((PTR = (TYPE *) malloc((MALLOCARGTYPE)((NUM)*sizeof(TYPE)))) == NULL) \
  13.       REPORT_ERROR (ERR_MALLOC); else
  14.  
  15.  
  16.  
  17. /** TRANSLATING BSD TO SYSTEM V **/
  18.  
  19. #if defined(THINK_C) || defined(__MSDOS__)
  20. #define bzero(PTR,NUMBYTES)  memset(PTR,0,(size_t)NUMBYTES)
  21. #define bcopy(SRC,DEST,NUMBYTES)  memcpy(DEST,SRC,(size_t)NUMBYTES)
  22. #define bcmp(B1,B2,NUMBYTES)   memcmp(B1,B2,(size_t)NUMBYTES)
  23. #define irint   /*nothing: very risky! */
  24. #endif
  25.